package com.ttc.mBackup.BackupAgent;

import com.dropbox.client.DropboxAPI;

import com.ttc.mBackup.R;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class DropBoxMain extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
	/*Define Button  */
	Button btn1,btn2;
	/*Define LoginDropbox object*/
	private LoginDropbox login = new LoginDropbox();
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activitychoose);
        btn1= (Button) findViewById(R.id.Login_btn);
        btn2=(Button) findViewById(R.id.Signup_btn);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
    }

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		Button b = (Button) arg0;
		switch(b.getId())
		{
		case R.id.Login_btn : 
			Intent i = new Intent("com.ttc.mBackup.BackupAgent.LOGINDROPBOX");
			startActivityForResult(i,1);
			break;
		case R.id.Signup_btn : 
			Intent reg =new Intent(android.content.Intent.ACTION_VIEW,
									Uri.parse("https://www.dropbox.com/register"));
			startActivity(reg);
			
		break;
		}
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		// TODO Auto-generated method stub
		if(requestCode==1)
		{
			if(resultCode==RESULT_OK)
			{
			
					finish();
				
			}
		}
	}
		
}
	
	